<template>
  <component :is="props.tag" :style="elStyle" v-bind="props.attr" v-on="events">
    <slot name="default" />
  </component>
</template>

<script lang="ts">
export default { name: 'TemplateText' };
</script>
<script setup lang="ts">
import { computed, PropType } from 'vue';
import { IPropsType } from '../../store/storeTypes';

const _props = defineProps({
  props: {
    type: Object as PropType<IPropsType>,
    default: () => ({})
  },
  events: {
    // eslint-disable-next-line no-undef
    type: Object as PropType<{ [type in keyof HTMLElementEventMap]: (e: Event) => void }>,
    default: () => ({})
  }
});
const elStyle = computed(() => _props.props.style);
</script>
